﻿@namespace BootstrapBlazor.Components

<div class="swal2-header">
    @if (Category == SwalCategory.Success)
    {
        <div class="@IconClassString">
            <div class="swal2-success-circular-line-left"></div>
            <span class="swal2-success-line-tip"></span><span class="swal2-success-line-long"></span>
            <div class="swal2-success-ring"></div><div class="swal2-success-fix"></div>
            <div class="swal2-success-circular-line-right"></div>
        </div>
    }
    else if (Category == SwalCategory.Error)
    {
        <div class="@IconClassString">
            <span class="swal2-x-mark">
                <span class="swal2-x-mark-line-left"></span>
                <span class="swal2-x-mark-line-right"></span>
            </span>
        </div>
    }
    else
    {
        <div class="@IconClassString"></div>
    }
    @if (!string.IsNullOrEmpty(Title))
    {
        <h2 class="swal2-title">@Title</h2>
    }
</div>

@if (BodyTemplate != null)
{
    @BodyTemplate
}
else
{
    <div class="swal2-content d-flex">
        @Content
    </div>
}

<div class="swal2-actions">
    @if (ShowClose)
    {
        <button type="button" class="btn btn-secondary" @onclick="@OnClickClose">
            <i class="fa fa-times"></i>
            <span>@(IsConfirm ? CancelButtonText : CloseButtonText)</span>
        </button>
    }
    @if (IsConfirm)
    {
        <button type="button" class="btn btn-danger ml-3" @onclick="@OnClickConfirm">
            <i class="fa fa-check"></i>
            <span>@ConfirmButtonText</span>
        </button>
    }
    @ButtonTemplate
</div>

@if (ShowFooter)
{
    <div class="swal2-footer d-flex">
        @FooterTemplate
    </div>
}